home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00a.txt
/
000073_icon-group-sender _Wed Apr 19 13:56:55 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA01199
for icon-group-addresses; Wed, 19 Apr 2000 13:56:30 -0700 (MST)
Message-Id: <200004192056.NAA01199@baskerville.CS.Arizona.EDU>
From: Steve Wampler <swampler@noao.edu>
X-Newsgroups: comp.lang.icon
Subject: Re: Reversible assignment really reversible ?
Date: Wed, 19 Apr 2000 13:25:45 -0700
X-Trace: noao.edu 956175946 66179 140.252.38.6 (19 Apr 2000 20:25:46 GMT)
X-Complaints-To: abuse@noao.edu
To: "F.G. van DORP" <F.G.van.Dorp@digimedia.nl>
X-Accept-Language: en
To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
"F.G. van DORP" wrote:
>
> On 17 Apr 2000 16:33:32 -0400, "Frank J. Lhota"
> <NOSPAM.Frank.Lhota@lexma.meitech.com> wrote:
>
> >...
> >
> >If I understand your question correctly, you are wondering why reversible
> >assignment fails after resumption. The reason for this is that it would have
> >an undesired effect on control backtracking. Consider the scanning
> >expression above, where text is "queen":
> >
> > (i <- 3) assigns 3 to i and suspends;
> > (j < find("q")) fails, so we resume the most recently
> Surely you mean i <=
No, he means i <- 3, "<-" is the reversible assignment operation.
(The assignment operation ":=" is not reversible. "<=" is a comparison
operator and does no assignment.)
> However, with the present implementation the first rev.assignment that gets
> resumed in a compound expression, will make the whole expression fail.
No, it will continue performing control backtracking until all subexpressions
have no more results.
> Such a waste...
No, it's vital to a correct implementation of data backtracking. Otherwise
you cannot do compound reversible assignments, as in:
row[r] <- down[r+c+1] <- up[8+r-c] <- r
or even the more simple:
if f((k <- 1 to 3), (n <- "a"|"b"|"c")) then ....
(If the backtracking into reversible assignment were to succeed, you'd
then do *forward* evaluation from that point instead of continuing back
through the expression, which means you would not be assured of having
tried all possible combinations of results from all subexpressions.)
> Besides, I'd imagine you'd avoid using regular assignments in compound
> expressions in the first place: should the expression fail in the end, all
> succesful regular assignments within this expression would still
> be permanent, contrary to rev.assignments (your version or mine).
Depends on what you're trying to do, you may want some assignments to
be permanent regardless of the outcome of the entire evaluation...
--
Steve Wampler- SOLIS Project, National Solar Observatory
swampler@noao.edu